package com.headStorm.freemark;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.math.MathUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ByteUtil;
import cn.hutool.core.util.HexUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.http.HttpUtil;
import org.checkerframework.checker.interning.qual.UsesObjectEquals;

import javax.xml.transform.Source;
import java.awt.*;
import java.io.UnsupportedEncodingException;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.cnblogs.com/sun-flower1314/p/10126111.html 使用 freemark生成word文档
 * @author zhangqq
 * @create 2021-10-19 17:12
 **/
public class MyTest {
    public static void main(String[] args) throws UnsupportedEncodingException {
        ExportMyWord emw = new ExportMyWord();
        Map<String, Object> dataMap = new HashMap<String, Object>();
        dataMap.put("test", "黄xx");

        List<Map<String, String>> users = new ArrayList<>();
        Map<String, String> user1 = new HashMap<>();
        user1.put("name", "111");
        user1.put("sex", "男");


        Map<String, String> user2 = new HashMap<>();
        user2.put("name", "1111");
        user2.put("sex", "男");

        users.add(user1);
        users.add(user2);

        dataMap.put("users", users);

        emw.createWord(dataMap, "test.ftl", "d:/简历.doc");


    }

}
